import numpy as np

from utils.binary_images.handle_binary_image import handle_binary_image
from utils.binary_images.handle_binary_image_2 import handle_binary_image_2
from utils.binary_images.join_line_array import join_line_array
from utils.group_connected import group_connected


def handle_binary_image_entry():
    image_array = np.array([
        [0, 0, 0, 1, 1, 1, 0, 0],
        [0, 1, 1, 1, 1, 1, 1, 0],
        [0, 1, 1, 1, 1, 1, 1, 0],
        [1, 1, 1, 1, 1, 1, 1, 1],
        [0, 1, 1, 1, 1, 1, 1, 1],
        [0, 1, 1, 1, 1, 1, 1, 0],
        [0, 0, 0, 1, 1, 0, 0, 0],
    ])

    handle_binary_image_2(image_array)
    width = image_array.shape[1]; height = image_array.shape[0]
    # width = 1; height = 1
    handle_binary_image(image_array, np.zeros(width), np.zeros(width), np.zeros(height), np.zeros(height))

    # 原始二维数组
    arr = np.array([[7, 5], [2, 5], [4, 8], [7, 4], [4, 15], [15, 32]])
    result = join_line_array(arr)

    result_2 = join_line_array(np.array([[1, 2], [2, 3], [3, 1], [6, 7], [7, 8], [8, 6]]))
    t = 12


